# Maintainer: Chih-Hsuan Yen <yan12125@archlinux.org>
# Maintainer: Johannes Löthberg <johannes@kyriasis.com>

pkgname=python-flask-cors
pkgver=3.0.10
pkgrel=5

pkgdesc='A Flask extension adding a decorator for CORS support'
url='https://pypi.org/project/Flask-Cors'
arch=('any')
license=('MIT')

depends=('python-flask' 'python-six')
makedepends=('python-setuptools')

source=("https://pypi.org/packages/source/F/Flask-Cors/Flask-Cors-$pkgver.tar.gz")

sha256sums=('b60839393f3b84a0f3746f6cdca56c1ad7426aa738b70d6c61375857823181de')

build() {
	cd Flask-Cors-$pkgver
	python setup.py build
}

check() {
	cd Flask-Cors-$pkgver
	# Upstream uses nosetests, which appears to test all Pyton files,
	# while unittest discovers test*.py only by default.
	python -m unittest discover -p '*test*.py'
}

package() {
	cd Flask-Cors-$pkgver
	python setup.py install --root="$pkgdir" --optimize=1 --skip-build
	install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE
}
